<template>
	<view>
		<view style="display: flex;flex-direction: column;" >
			<view style="border-bottom: 1px solid #CCCCCC;padding: 5px 0;" v-for="(item,index) in nowmsg" :key='index' @click="goinfo(item)">
				<view style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 5px;">
					<text style="font-size: 20px;margin-left: 5px;">{{item.title}}</text><text style="color: #CCCCCC;">{{item.add_time}}</text>
				</view>
				<view style="color: #CCCCCC;margin-left: 5px;width: 200px;overflow: hidden;
        word-break: break-all;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;"  >
					{{item.content}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nowmsg:[]
			}
		},
		onShow() {
			uni.request({
				url: this.G_base + '/api/lz/xtxx',
				method: 'GET',
				header: {
					'content-type': 'application/x-www-form-urlencoded',
				},
				success: res => {
					if (res.data.status == 200) {
						this.nowmsg=res.data.data
					}
				}
			})
		},
		methods: {
			goinfo(e){
				uni.navigateTo({
					url:"/pages/msglist/Detailsinfo?info="+JSON.stringify(e)
				})
			}
		}
	}
</script>

<style>

</style>
